<h1>Listing types</h1>

<table width="100%"   cellspacing="4" cellpadding="4" border="0" align="center" bgcolor="#f0f0f0">
<tbody>
<tr BGCOLOR=#FFCC33>
    <td>Type</td>
    <td>Position</td>  
    <td>Action</td> 
</tr>
  
<% for type in @types %>
  <tr>
    <td><%=link_to type.title ,{:controller => "/admin/category", :action => "view",:id=>type},{:title=>type.description}%>(<%=type.topics_count%>)</td>
    <td><%=link_to type.position ,{}%></td>  

    
    <td><%= link_to 'Show', :action => 'show', :id => type %>
    ,<%= link_to 'Edit', :action => 'edit', :id => type %>
    ,<%= link_to 'Destroy', { :action => 'destroy', :id => type }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @type_pages.current.previous } if @type_pages.current.previous %>
<%= link_to 'Next page', { :page => @type_pages.current.next } if @type_pages.current.next %> 

<br />

<%= link_to 'New type', :action => 'new' %>
